package com.qf.shop.service.impl;


import com.qf.shop.dao.TypeDao;
import com.qf.shop.dao.impl.TypeDaoImpl;
import com.qf.shop.entity.Type;
import com.qf.shop.service.TypeService;

import java.sql.SQLException;
import java.util.List;

public class TypeServiceImpl  implements TypeService{
    TypeDao typeDao = new TypeDaoImpl();
    @Override
    public List<Type> findAllType() throws SQLException {
        return typeDao.selectAll();
    }

    @Override
    public int delete(String tid) {
        return typeDao.deleteTypeByTid(tid);
    }

    @Override
    public int update(Type type) {
        return typeDao.updateTypeByTid(type);
    }

    @Override
    public int insert(String tname, String tinfo){
        return typeDao.insertType(tname,tinfo);
    }
}
